import React, { memo } from "react";
import { AskUserRelatedMomentWrapper } from "./style";
import { Route, Link, useHistory } from "react-router-dom";

export default memo(function index(props) {
  const { relatedList } = props;

  return (
    <AskUserRelatedMomentWrapper>
      <div className="title">近期文章</div>
      <div className="related-list">
        {relatedList.map((item) => {
          return (
            <div className="p-list-item" key={item.id}>
              <Link to={`/momentdetail?id=${item.id}`} target="_blank">
                <div className="content">{item.content}</div>
                <div className="like">
                  <div className="love">{item.love_num}赞</div>
                  <div className="hate">{item.comment_num}评论</div>
                </div>
              </Link>
            </div>
          );
        })}
      </div>
    </AskUserRelatedMomentWrapper>
  );
});
